package com.edu.system.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.edu.system.domain.TStudyScore;
import com.edu.system.domain.vo.AvgExamSchoolRankVO;
import com.edu.system.domain.vo.CountStudentExamVO;
import com.edu.system.domain.vo.TotalScoreVO;

/**
 * 成绩Mapper接口
 * 
 * @author xxxx
 * @date 2023-12-29
 */
public interface TStudyScoreMapper 
{
    /**
     * 查询成绩
     * 
     * @param id 成绩主键
     * @return 成绩
     */
    public TStudyScore selectTStudyScoreById(Long id);

    /**
     * 查询成绩列表
     * 
     * @param tStudyScore 成绩
     * @return 成绩集合
     */
    public List<TStudyScore> selectTStudyScoreList(TStudyScore tStudyScore);

    public List<TStudyScore> queryStudyScore(@Param("stuNo") String stuNo,@Param("lessonName") String lessonName, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 新增成绩
     * 
     * @param tStudyScore 成绩
     * @return 结果
     */
    public int insertTStudyScore(TStudyScore tStudyScore);

    public int batchInsert(@Param("scoreList") List<TStudyScore> scoreList);

    /**
     * 修改成绩
     * 
     * @param tStudyScore 成绩
     * @return 结果
     */
    public int updateTStudyScore(TStudyScore tStudyScore);

    /**
     * 删除成绩
     * 
     * @param id 成绩主键
     * @return 结果
     */
    public int deleteTStudyScoreById(Long id);

    public int deleteByExamId(Long[] examIds);

    /**
     * 批量删除成绩
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTStudyScoreByIds(Long[] ids);

    public int deleteScore(@Param("examId") Long examId, @Param("stuNos") List<String> stuNos);
    /**
     * 获取学生学科列表
     * @param stuNo
     * @return
     */
    public List<String> queryLessonsByEduId(String stuNo);
    /**
     * 获取学生最后两次考试的平均名次
     * @param stuNo
     * @return
     */
    public List<AvgExamSchoolRankVO> queryLastTwoLessonsByEduId(String stuNo);
    
    public List<CountStudentExamVO> countExamStuNum(Map<String , Object> map);
    
    public List<TotalScoreVO> getTotalScoreByClass(Map<String , Object> map);
    
    public List<TStudyScore> getHonorsClassTopStudentSummary(Map<String , Object> map);


}
